<%@ page language="java" import="java.util.*" pageEncoding="UTF8"%>
<%@page import="iwpl.project.entities.Accounts"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.Date"%>
<%@page import="iwpl.project.entities.*"%>
<%@page import="iwpl.project.dao.*"%>
<%@page import="iwpl.project.interfaces.*"%>
<%@page import="iwpl.project.servlet.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<center>

	<html>
		<head>
			<base href="<%=basePath%>">
<script type="text/javascript" src="js/jquery-Source.js"></script>
		<script type="text/javascript" src="js/jquery-Validation.js"></script>
		<link href="css/CommonCSS.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			$(document).ready(function() {
				$("#Department").validate();
			});
		</script>
			<title>CreateAccount</title>

			<meta http-equiv="pragma" content="no-cache">
			<meta http-equiv="cache-control" content="no-cache">
			<meta http-equiv="expires" content="0">
			<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
			<meta http-equiv="description" content="This is my page">
			<script type="text/javascript" src="js/jquery-Source.js"></script>
			<script type="text/javascript" src="js/jquery-Validation.js"></script>
			<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
			
		</head>

		<body>
			<form name="frmInsertAccount" id="Department" action="./servlet/Control_Account"method="get">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td>

							<table>
								<tr>
									<td colspan="3" align="center">
										<h1>
											Account
										</h1>
									</td>
								</tr>
								<tr>
									<td>
										EmployeeID:
									</td>
									<td colspan="2">
										<input type="hidden" name="aid" />
										<input type="hidden" name="action" value="Insert" />
										<input name="txtEmployeeID" class="request"/>
									</td>
									
								</tr>
								<tr>

									<td>
										RoleName:
									</td>
									<td colspan="2">
										
										<select name="cboRoleID">
											<%
												
												try {
												
													RolesDAO objDao= new RolesDAO();
													List<Roles> lstOff = objDao.findAll();
													int RoleID = 0;
													String RoleName = "";
													for( Iterator it = lstOff.iterator(); it.hasNext(); ) {
																Roles apart = (Roles)it.next();
													
													
														RoleID = apart.getId();
														RoleName = apart.getRoleName();
														out.println("<option value='" + RoleID + "'>" + RoleName);
													}
												} catch (Exception e) {
												}
											%>
										</select>
										
										
									</td>
								</tr>
								<tr>
									<td>
										UseName:
									</td>
									<td colspan="2">
										<input id="txtUserName" name="txtUserName" class="required"/>
									</td>
								</tr>
								<tr>
									<td>
										Active:
									</td>
									<td colspan="2">
										<input type="checkbox" name="chkActive" " />
									</td>
								</tr>
								
								<tr>
									<td>
										Password:
									</td>
									<td colspan="2">
										<input type="password" class="required" name="txtPass" />
									</td>
								</tr>
								<tr>
									<td>
										<input type="submit" name="btnSave" value="Save" />
									</td>
									<td colspan="2">
										<input type="button" name="btnCancel" value="Cancel" onclick="self.location='Manage_Account.jsp'"/>
									</td>
								</tr>
								<tr>
									<td colspan="3">
										<%
											if(request.getParameter("message")!=null)
											{
												String a = request.getParameter("message").toString();
												out.print(a);
											}
										 %>
									</td>
								</tr>
							</table>

						</td>
					</tr>
				</table>
			</form>

		</body>
	</html>
</center>